﻿using System;
using System.Linq.Expressions;
using DevExpress.XtraBars.Docking2010;

namespace Loki.UI.Win
{
    public class DocumentBinder : Binder
    {
        public void Bind<TModel>(DocumentManager manager, Expression<Func<TModel, object>> propertyGetter) where TModel : class
        {
            manager.ShowThumbnailsInTaskBar = DevExpress.Utils.DefaultBoolean.False;

            var containerModel = GetContainer<TModel>(manager.ContainerControl, propertyGetter);
            if (containerModel == null)
            {
                return;
            }

            UIContext.Templates.CreateBind(manager, containerModel);
        }
    }
}